<template>
  <div class="containerTable">
    <!--表5蔬菜生产经营实体表T_VegProsecution-->
    <Row class="divSearch">
            <Col span="24" class="col-margin">
            <!--根据需求删除不不要查询条件-->
            填报年度：
            <Select v-model="searchModel.FillInYear" placeholder="全部" style="width: 200px" @on-change="GetData()">
                <!-- <Option value="">全部</Option> -->
                <Option :value="item.DictText" v-for="item in CreateYearList" :key="item.DictValue">{{item.DictText}}</Option>
            </Select>
            <!--时间周期：
            <Select v-model="searchModel.TimesType" placeholder="全部" style="width: 100px" @on-change="GetData()">
                <Option value="">全部</Option>
                <Option :value="item.DictValue" v-for="item in CycleList" :key="item.DictValue">{{item.DictText}}</Option>
            </Select>-->
                <Button icon="ios-search" type="ghost" @click="GetData()">查询</Button>                        
                <Button icon="ios-download" type="primary" @click="ExcelDown()" style="float:right;margin-right:20px" v-show="DataModel.ReportStatus >1">数据导出</Button>
                <Upload :on-success="handleSuccess" :action="GetPostUrl()" style="float:right;margin-right:20px" v-show="DataModel.ReportStatus <3&&isTime()">
                    <Button type="primary" icon="ios-cloud-upload-outline">数据导入</Button>
                </Upload>
                <Button icon="ios-download" type="primary" @click="TmpDown()" style="float:right;margin-right:20px">模板下载</Button>
            </Col>
        </Row>
        <Row>
            <Col span="24" class="col-margin" v-show="isTime()">
                <Form ref="DataModel" :model="DataModel" :rules="ruleModel" > 
                <table  class="reptable">
                     <caption>
                        <label style="float:left;font-size:20px;color:#050505">{{searchModel.FillInYear}}水果生产经营实体情况表（全面统计）</label>
                        <lable style="float:right" v-show="DataModel.ReportStatus==0">[<a @click="ReasonShow=true">未通过原因</a>]</lable>
                        <label style="float:right">当前状态:
                            <span v-if="DataModel.ReportStatus==0" class="Error">退回重报</span> 
                            <span v-else-if="DataModel.ReportStatus==1" class="NoReport">未填写</span>
                            <span v-else-if="DataModel.ReportStatus==2" class="AlreadyReport">已填写</span>
                            <span v-else-if="DataModel.ReportStatus==3" class="UpReport">已上报</span>
                            <span v-else-if="DataModel.ReportStatus==4" class="Success">审核通过</span>               
                            <span v-else class="Error">异常</span>               
                        </label>
                    </caption>
                    <thead>
                    <tr>
                        <th style="width:45%">名称</th>
                        <th style="width:20%">计量单位</th>
                        <th style="width:35%">数量</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <th style="text-align:left;">一、水果市场个数</th>
                        <th>个</th>
                        <th>
                            <Poptip trigger="hover" title="上年数据" :content="DataModel.OldMarketNum"> 
                                <Form-item prop="MarketNum">  
                                    <!-- <Input v-model="DataModel.MarketNum" disabled="true"></Input> -->
                                    <Button long>{{DataModel.MarketNum}}</Button>
                                    <td style="display:none">{{DataModel.MarketNum = DataModel.CdxMarket*1+DataModel.ZypfMarket*1+DataModel.QyxzhpfMarket*1}}</td>
                                </Form-item>
                            </Poptip>
                        </th>
                    </tr>
                    <tr>
                        <td style="padding-left:10em;">其中：产地性市场</td>
                        <td style="text-align:center;">个</td>
                        <td>
                            <Poptip trigger="focus" title="上年数据" :content="DataModel.OldCdxMarket"> 
                                <Form-item prop="CdxMarket">  
                                    <Input v-model="DataModel.CdxMarket"></Input>
                                </Form-item>
                            </Poptip>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">专业批发市场</td>
                        <td style="text-align:center;">个</td>
                        <td>
                            <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZypfMarket"> 
                                <Form-item prop="ZypfMarket">  
                                    <Input v-model="DataModel.ZypfMarket"></Input>
                                </Form-item>
                            </Poptip>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">区域性综合批发市场</td>
                        <td style="text-align:center;">个</td>
                        <td>
                            <Poptip trigger="focus" title="上年数据" :content="DataModel.OldQyxzhpfMarket"> 
                                <Form-item prop="QyxzhpfMarket">  
                                    <Input v-model="DataModel.QyxzhpfMarket"></Input>
                                </Form-item>
                            </Poptip>
                        </td>
                    </tr>
                    <tr>
                        <th style="text-align:left;">二、水果企业个数</th>
                        <th>个</th>
                        <th>
                            <Poptip trigger="hover" title="上年数据" :content="DataModel.OldFruCompanyNum"> 
                                <Form-item prop="FruCompanyNum">  
                                    <!-- <Input v-model="DataModel.FruCompanyNum"></Input> -->
                                     <Button long>{{DataModel.FruCompanyNum}}</Button>
                                    <td style="display:none">{{DataModel.FruCompanyNum = DataModel.ZzNum_country*1+DataModel.ZzNum_pro*1+DataModel.ZzNum_city*1+DataModel.ZzNum_county*1+DataModel.ZzNum_other*1}}</td>
                                </Form-item>
                            </Poptip>
                        </th>
                    </tr>
                    <tr>
                        <td style="padding-left:10em;">其中：国家级龙头企业</td>
                        <td style="text-align:center;">个</td>
                        <td>
                            <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZzNum_country"> 
                                <Form-item prop="ZzNum_country">  
                                    <Input v-model="DataModel.ZzNum_country"></Input>
                                </Form-item>
                            </Poptip>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">省级龙头企业</td>
                        <td style="text-align:center;">个</td>
                        <td>
                            <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZzNum_pro"> 
                                <Form-item prop="ZzNum_pro">  
                                    <Input v-model="DataModel.ZzNum_pro"></Input>
                                </Form-item>
                            </Poptip>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">州（市）级龙头企业</td>
                        <td style="text-align:center;">个</td>
                        <td>
                            <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZzNum_city"> 
                                <Form-item prop="ZzNum_city">  
                                    <Input v-model="DataModel.ZzNum_city"></Input>
                                </Form-item>
                            </Poptip>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">县（市、区）级龙头企业</td>
                        <td style="text-align:center;">个</td>
                        <td>
                            <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZzNum_county"> 
                                <Form-item prop="ZzNum_county">  
                                    <Input v-model="DataModel.ZzNum_county"></Input>
                                </Form-item>
                            </Poptip>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">其他</td>
                        <td style="text-align:center;">个</td>
                        <td>
                            <Poptip trigger="focus" title="上年数据" :content="DataModel.OldZzNum_other"> 
                                <Form-item prop="ZzNum_other">  
                                    <Input v-model="DataModel.ZzNum_other"></Input>
                                </Form-item>
                            </Poptip>
                        </td>
                    </tr>
                     <!-- <tr>
                        <td style="padding-left:13em;">(种植企业)个体工商户</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZzNum_singel"><Form-item prop="ZzNum_singel"><Input v-model="DataModel.ZzNum_singel"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">(按营业额分)其中：1000万元以下</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZzNum_yye1"><Form-item prop="ZzNum_yye1"><Input v-model="DataModel.ZzNum_yye1"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">(按营业额分)1000～5000万元</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZzNum_yye2"><Form-item prop="ZzNum_yye2"><Input v-model="DataModel.ZzNum_yye2"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">(按营业额分)5000～10000万元</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZzNum_yye3"><Form-item prop="ZzNum_yye3"><Input v-model="DataModel.ZzNum_yye3"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">(按营业额分)1亿元以上</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZzNum_yye4"><Form-item prop="ZzNum_yye4"><Input v-model="DataModel.ZzNum_yye4"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">(按营业额分)5亿元以上</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZzNum_yye5"><Form-item prop="ZzNum_yye5"><Input v-model="DataModel.ZzNum_yye5"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">(按营业额分)10亿元以上</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZzNum_yye6"><Form-item prop="ZzNum_yye6"><Input v-model="DataModel.ZzNum_yye6"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">(从事水果产品加工)企业数</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldSgjgNum"><Form-item prop="SgjgNum"><Input v-model="DataModel.SgjgNum"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">(从事水果营销)企业数</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldSgyxNum"><Form-item prop="SgyxNum"><Input v-model="DataModel.SgyxNum"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">(从事水果营销)其中：水果外贸的企业</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldSgwmNum"><Form-item prop="SgwmNum"><Input v-model="DataModel.SgwmNum"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">(从事水果营销)其中：开展电子商务的企业</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldDzswNum"><Form-item prop="DzswNum"><Input v-model="DataModel.DzswNum"></Input></Form-item></Poptip></td>
                    </tr> -->
                    <!-- <tr>
                        <th style="text-align:left;">二、水果生产合作组织</th>
                        <th>个</th>
                        <th><Poptip trigger="focus" title="上年数据" :content="DataModel.OldHzNum"><Form-item prop="HzNum"><Input v-model="DataModel.HzNum"></Input></Form-item></Poptip></th>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">1.水果专业合作组织数量</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZyhzNum"><Form-item prop="ZyhzNum"><Input v-model="DataModel.ZyhzNum"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">2.参加农民合作组织农户数</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldNhhzNum"><Form-item prop="NhhzNum"><Input v-model="DataModel.NhhzNum"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">3.农民专业合作组织种植面积</td>
                        <td style="text-align:center;">亩</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldNmzyhzNum"><Form-item prop="NmzyhzNum"><Input v-model="DataModel.NmzyhzNum"></Input></Form-item></Poptip></td>
                    </tr> -->
                    <tr>
                        <th colspan="3" style="text-align:left;">三、水果农民合作社</th>
                        <!-- <th></th>
                        <th></th> -->
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">1.农民合作社数量</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldHzNum"><Form-item prop="HzNum"><Input v-model="DataModel.HzNum"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">2.参加农民合作社农户数</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldNhhzNum"><Form-item prop="NhhzNum"><Input v-model="DataModel.NhhzNum"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">3.农民专业合作组织经营面积</td>
                        <td style="text-align:center;">亩</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldNmzyhzNum"><Form-item prop="NmzyhzNum"><Input v-model="DataModel.NmzyhzNum"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:16em;">其中：流转土地面积</td>
                        <td style="text-align:center;">亩</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldHzlzArea"><Form-item prop="HzlzArea"><Input v-model="DataModel.HzlzArea"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">4.农民合作社年销售收入</td>
                        <td style="text-align:center;">万元</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldNmhzYincome"><Form-item prop="NmhzYincome"><Input v-model="DataModel.NmhzYincome"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <th colspan="3" style="text-align:left;">四、水果家庭农场</th>
                        <!-- <th></th>
                        <th></th> -->
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">1.水果家庭农场数量</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldJtncNum"><Form-item prop="JtncNum"><Input v-model="DataModel.JtncNum"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">2.参加水果家庭农场农户数</td>
                        <td style="text-align:center;">户</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldJtncnhNum"><Form-item prop="JtncnhNum"><Input v-model="DataModel.JtncnhNum"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">3.水果家庭农场经营面积</td>
                        <td style="text-align:center;">亩</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldJtncjyArea"><Form-item prop="JtncjyArea"><Input v-model="DataModel.JtncjyArea"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:16em;">其中：流转土地面积</td>
                        <td style="text-align:center;">亩</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldJtnclzArea"><Form-item prop="JtnclzArea"><Input v-model="DataModel.JtnclzArea"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">4.水果家庭农场年销售收入</td>
                        <td style="text-align:center;">万元</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldJtncYincome"><Form-item prop="JtncYincome"><Input v-model="DataModel.JtncYincome"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <th colspan="3" style="text-align:left;">五、相关质量标准认证情况</th>
                        <!-- <th></th>
                        <th></th> -->
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（一）国家级农业标准化示范县数量</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_sfx"><Form-item prop="ZlrzNum_sfx"><Input v-model="DataModel.ZlrzNum_sfx"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（二）出口食品农产品质量安全示范区数量</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_sfq"><Form-item prop="ZlrzNum_sfq"><Input v-model="DataModel.ZlrzNum_sfq"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（三）中国驰名商标数</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZgcmsbNum"><Form-item prop="ZgcmsbNum"><Input v-model="DataModel.ZgcmsbNum"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（四）中国名牌产品数</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZgmpcpNum"><Form-item prop="ZgmpcpNum"><Input v-model="DataModel.ZgmpcpNum"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（五）云南省著名商标数</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldYnszmsbNum"><Form-item prop="YnszmsbNum"><Input v-model="DataModel.YnszmsbNum"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（六）无公害农产品数</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_wghNum"><Form-item prop="ZlrzNum_wghNum"><Input v-model="DataModel.ZlrzNum_wghNum"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（七）无公害农产品认证面积</td>
                        <td style="text-align:center;">亩</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_wghmj"><Form-item prop="ZlrzNum_wghmj"><Input v-model="DataModel.ZlrzNum_wghmj"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（八）绿色产品数</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_bluecp"><Form-item prop="ZlrzNum_bluecp"><Input v-model="DataModel.ZlrzNum_bluecp"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（九）绿色产品认证面积</td>
                        <td style="text-align:center;">亩</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_bluecpmj"><Form-item prop="ZlrzNum_bluecpmj"><Input v-model="DataModel.ZlrzNum_bluecpmj"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（十）地理标志证明商标数</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_dlsb"><Form-item prop="ZlrzNum_dlsb"><Input v-model="DataModel.ZlrzNum_dlsb"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（十一）地理标志产品保护认证数</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_dlbh"><Form-item prop="ZlrzNum_dlbh"><Input v-model="DataModel.ZlrzNum_dlbh"></Input></Form-item></Poptip></td>
                    </tr> 
                    <!-- <tr>
                        <th style="text-align:left;"> 三、从事水果种植的农户数</th>
                        <th>户</th>
                        <th><Poptip trigger="focus" title="上年数据" :content="DataModel.OldSgzzNhNum"><Form-item prop="SgzzNhNum"><Input v-model="DataModel.SgzzNhNum"></Input></Form-item></Poptip></th>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">其中：种植大户</td>
                        <td style="text-align:center;">户</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZZDHNum"><Form-item prop="ZZDHNum"><Input v-model="DataModel.ZZDHNum"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（一）100亩以下</td>
                        <td style="text-align:center;">户</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZZDHOne"><Form-item prop="ZZDHOne"><Input v-model="DataModel.ZZDHOne"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（二）100亩-500亩</td>
                        <td style="text-align:center;">户</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZZDHTwo"><Form-item prop="ZZDHTwo"><Input v-model="DataModel.ZZDHTwo"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（三）500亩以上</td>
                        <td style="text-align:center;">户</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZZDHThree"><Form-item prop="ZZDHThree"><Input v-model="DataModel.ZZDHThree"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（一）育苗基地数量</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldYmjdNum"><Form-item prop="YmjdNum"><Input v-model="DataModel.YmjdNum"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（二）育苗数量（万株）（备注：育苗作物）</td>
                        <td style="text-align:center;">万株</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldYmNum"><Form-item prop="YmNum"><Input v-model="DataModel.YmNum"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（一）国家级农业标准化示范县数量</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_sfx"><Form-item prop="ZlrzNum_sfx"><Input v-model="DataModel.ZlrzNum_sfx"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（二）出口食品农产品质量安全示范区数量</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_sfq"><Form-item prop="ZlrzNum_sfq"><Input v-model="DataModel.ZlrzNum_sfq"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（三）注册商标数</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_sbs"><Form-item prop="ZlrzNum_sbs"><Input v-model="DataModel.ZlrzNum_sbs"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（四）出口基地备案面积</td>
                        <td style="text-align:center;">万亩</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_bamj"><Form-item prop="ZlrzNum_bamj"><Input v-model="DataModel.ZlrzNum_bamj"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（五）GAP认证面积</td>
                        <td style="text-align:center;">万亩</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_rzmj"><Form-item prop="ZlrzNum_rzmj"><Input v-model="DataModel.ZlrzNum_rzmj"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（六）GAP认证产品数量</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_rzsl"><Form-item prop="ZlrzNum_rzsl"><Input v-model="DataModel.ZlrzNum_rzsl"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（七）无公害农产品数</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_wghNum"><Form-item prop="ZlrzNum_wghNum"><Input v-model="DataModel.ZlrzNum_wghNum"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（八）无公害农产品认证面积</td>
                        <td style="text-align:center;">亩</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_wghmj"><Form-item prop="ZlrzNum_wghmj"><Input v-model="DataModel.ZlrzNum_wghmj"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（九）绿色产品数</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_bluecp"><Form-item prop="ZlrzNum_bluecp"><Input v-model="DataModel.ZlrzNum_bluecp"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（十）绿色产品认证面积</td>
                        <td style="text-align:center;">亩</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_bluecpmj"><Form-item prop="ZlrzNum_bluecpmj"><Input v-model="DataModel.ZlrzNum_bluecpmj"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（十一）地理标志证明商标数</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_dlsb"><Form-item prop="ZlrzNum_dlsb"><Input v-model="DataModel.ZlrzNum_dlsb"></Input></Form-item></Poptip></td>
                    </tr>
                    <tr>
                        <td style="padding-left:13em;">（十二）地理标志产品保护认证数</td>
                        <td style="text-align:center;">个</td>
                        <td><Poptip trigger="focus" title="上年数据" :content="DataModel.OldZlrzNum_dlbh"><Form-item prop="ZlrzNum_dlbh"><Input v-model="DataModel.ZlrzNum_dlbh"></Input></Form-item></Poptip></td>
                    </tr> -->
                    </tbody>
                </table>
                </Form>
                <div style="text-align:right;padding:10px">
                    <Button type="primary" @click="save('DataModel')" :disabled="DataModel.ReportStatus < 3 && BtnSaveStatus ? false:true">保存</Button>
                    <Button type="primary" @click="DataUp(DataModel.ReportId)" :disabled="DataModel.ReportStatus == 2 ? false:true">上报</Button>
                </div>
                <div style="padding-bottom:60px;">
                    <Alert style="margin-top:5px;text-align:left;" banner type="error">
                        填报时间：每年1月10日</br>
                        填报说明: 1.全省范围内从乡（镇）起，逐级全面统计，由县级填报经州（市）审核后上报。
                        <span slot="desc">
                        </span>
                    </Alert>
                </div>
            </Col>
            <Col class="col-margin" v-show="!isTime()">
                <Alert class="AlterWarm">不在填报时间内，无法填报！</Alert>
            </Col>
        </Row>
         <Modal v-model="ReasonShow" :mask-closable="false" width="500"> 
            <p slot="header" class="title">
                <Icon type="ios-paper" size="20"></Icon>
                <span style="font-size: 20px">未通过原因</span>
            </p>
            <p slot="close">
                <Icon type="close-circled" color="red" size=25></Icon>
            </p>
            <div class="reasonDiv">{{DataModel.Opinion}}</div>
            <p slot="footer"></p>
        </Modal>              
    </div>
</template>
<script>
export default {
  data() {
    const validateData = (rule, value, callback) => {
      var temp = /^[0-9]\d*(\.\d+)?$/;
      if (value != null && value != "") {
        if (temp.test(value) == false) {
          callback(new Error("必须是数字"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    return {
      ReasonShow:false,//是否显示未通过原因Modal  
      ViewShow: false, //查看状态
      TableCodeList: this.GetGroupDict("ReportTableName"), //表名称
      CreateYearList: this.GetGroupDict("ReportYear"), //周期
      CycleList: this.GetGroupDict("ReportCycle"), //
      CurrentYear: new Date().getFullYear(), //当前年度,
      BtnSaveStatus: false,
      ruleValidate: {
        //验证模型
        TableName: [{ required: true, message: "报表名称不能为空", trigger: "blur" }],
        TableCode: [{ required: true, message: "报表代码不能为空", trigger: "blur" }],
        CreateYear: [{ required: true, message: "年度不能为空", trigger: "blur" }],
        Cycle: [{ required: true, message: "时间周期不能为空", trigger: "blur" }],
        CreateTime: [{ required: true, message: "生成时间不能为空", trigger: "blur" }]
      },
      DataModel: {
        //编辑模型
        Id: 0,
        ReportId: "",
        Opinion:'',
        FruCompanyNum: "",
        ZzNum_country: "",
        ZzNum_pro: "",
        ZzNum_city: "",
        ZzNum_county: "",
        ZzNum_other: "",
        ZzNum_singel: "",
        ZzNum_yye1: "",
        ZzNum_yye2: "",
        ZzNum_yye3: "",
        ZzNum_yye4: "",
        ZzNum_yye5: "",
        ZzNum_yye6: "",
        SgjgNum: "",
        SgyxNum: "",
        SgwmNum: "",
        NmzyhzNum: "",
        SgzzNhNum: "",
        ZZDHNum: "",
        ZZDHOne: "",
        ZZDHTwo: "",
        ZZDHThree: "",
        YmjdNum: "",
        YmNum: "",
        DzswNum: "",
        HzNum: "",
        ZyhzNum: "",
        NhhzNum: "",
        HzlzArea: "",
        NmhzYincome: "",
        ZgcmsbNum: "",
        ZgmpcpNum: "",
        YnszmsbNum: "",
        MarketNum: "",
        CdxMarket: "",
        ZypfMarket: "",
        QyxzhpfMarket: "",
        JtncNum: "",
        JtncnhNum: "",
        JtncjyArea: "",
        JtnclzArea: "",
        JtncYincome: "",
        ZlrzNum_sfx: "",
        ZlrzNum_sfq: "",
        ZlrzNum_sbs: "",
        ZlrzNum_bamj: "",
        ZlrzNum_rzmj: "",
        ZlrzNum_rzsl: "",
        ZlrzNum_wghmj: "",
        ZlrzNum_bluecp: "",
        ZlrzNum_bluecpmj: "",
        ZlrzNum_dlsb: "",
        ZlrzNum_dlbh: "",
        ZlrzNum_wghNum: "",
        ReportStatus: "",
        OldId: 0,
        OldReportId: "",
        OldFruCompanyNum: "",
        OldZzNum_country: "",
        OldzzNum_pro: "",
        OldzzNum_city: "",
        OldZzNum_county: "",
        OldZzNum_other: "",
        OldZzNum_singel: "",
        OldZzNum_yye1: "",
        OldZzNum_yye2: "",
        OldZzNum_yye3: "",
        OldZzNum_yye4: "",
        OldZzNum_yye5: "",
        OldZzNum_yye6: "",
        OldSgjgNum: "",
        OldSgyxNum: "",
        OldSgwmNum: "",
        OldNmzyhzNum: "",
        OldSgzzNhNum: "",
        OldZZDHNum: "",
        OldZZDHOne: "",
        OldZZDHTwo: "",
        OldZZDHThree: "",
        OldYmjdNum: "",
        OldYmNum: "",
        OldDzswNum: "",
        OldHzNum: "",
        OldZyhzNum: "",
        OldNhhzNum: "",
        OldHzlzArea: "",
        OldNmhzYincome: "",
        OldZgcmsbNum: "",
        OldZgmpcpNum: "",
        OldYnszmsbNum: "",
        OldMarketNum: "",
        OldCdxMarket: "",
        OldZypfMarket: "",
        OldQyxzhpfMarket: "",
        OldJtncNum: "",
        OldJtncnhNum: "",
        OldJtncjyArea: "",
        OldJtnclzArea: "",
        OldJtncYincome: "",
        OldZlrzNum_sfx: "",
        OldZlrzNum_sfq: "",
        OldZlrzNum_sbs: "",
        OldZlrzNum_bamj: "",
        OldZlrzNum_rzmj: "",
        OldZlrzNum_rzsl: "",
        OldZlrzNum_wghmj: "",
        OldZlrzNum_bluecp: "",
        OldZlrzNum_bluecpmj: "",
        OldZlrzNum_dlsb: "",
        OldZlrzNum_dlbh: "",
        OldZlrzNum_wghNum: "",
        OldReportStatus: ""
      },
      //查询模型：根据需求删除不不要查询条件
      searchModel: {
        ReportCode: "FruProsecution",
        FillInYear: "",
        TimesType: "",
        AreaCode: this.GetlocaStorage("fruuserinfo").AreaCode
      },
      ruleModel: {
        FruCompanyNum: [{ validator: validateData, trigger: "blur" }],
        ZzNum_pro: [{ validator: validateData, trigger: "blur" }],
        ZzNum_city: [{ validator: validateData, trigger: "blur" }],
        ZzNum_singel: [{ validator: validateData, trigger: "blur" }],
        ZzNum_country: [{ validator: validateData, trigger: "blur" }],        
        ZzNum_county: [{ validator: validateData, trigger: "blur" }],
        ZzNum_other: [{ validator: validateData, trigger: "blur" }],
        // ZzNum_yye1: [{ validator: validateData, trigger: "blur" }],
        // ZzNum_yye2: [{ validator: validateData, trigger: "blur" }],
        // ZzNum_yye3: [{ validator: validateData, trigger: "blur" }],
        // ZzNum_yye4: [{ validator: validateData, trigger: "blur" }],
        // ZzNum_yye5: [{ validator: validateData, trigger: "blur" }],
        // ZzNum_yye6: [{ validator: validateData, trigger: "blur" }],
        // SgjgNum: [{ validator: validateData, trigger: "blur" }],
        // SgyxNum: [{ validator: validateData, trigger: "blur" }],
        // SgwmNum: [{ validator: validateData, trigger: "blur" }],
         NmzyhzNum: [{ validator: validateData, trigger: "blur" }],//农民合作社经营面积
        // SgzzNhNum: [{ validator: validateData, trigger: "blur" }],
        // ZZDHNum: [{ validator: validateData, trigger: "blur" }],
        // ZZDHOne: [{ validator: validateData, trigger: "blur" }],
        // ZZDHTwo: [{ validator: validateData, trigger: "blur" }],
        // ZZDHThree: [{ validator: validateData, trigger: "blur" }],
        // YmjdNum: [{ validator: validateData, trigger: "blur" }],
        // YmNum: [{ validator: validateData, trigger: "blur" }],
        // DzswNum: [{ validator: validateData, trigger: "blur" }],
        HzNum: [{ validator: validateData, trigger: "blur" }],
        //ZyhzNum: [{ validator: validateData, trigger: "blur" }],
        NhhzNum: [{ validator: validateData, trigger: "blur" }],
        HzlzArea: [{ validator: validateData, trigger: "blur" }],
        NmhzYincome: [{ validator: validateData, trigger: "blur" }],
        ZgcmsbNum:[{ validator: validateData, trigger: "blur" }],
        ZgmpcpNum: [{ validator: validateData, trigger: "blur" }],
        YnszmsbNum: [{ validator: validateData, trigger: "blur" }],
        MarketNum: [{ validator: validateData, trigger: "blur" }],
        CdxMarket: [{ validator: validateData, trigger: "blur" }],
        ZypfMarket: [{ validator: validateData, trigger: "blur" }],
        QyxzhpfMarket: [{ validator: validateData, trigger: "blur" }],
        JtncNum: [{ validator: validateData, trigger: "blur" }],
        JtncnhNum: [{ validator: validateData, trigger: "blur" }],
        JtncjyArea: [{ validator: validateData, trigger: "blur" }],
        JtnclzArea: [{ validator: validateData, trigger: "blur" }],
        JtncYincome: [{ validator: validateData, trigger: "blur" }],

        ZlrzNum_sfx: [{ validator: validateData, trigger: "blur" }],
        ZlrzNum_sfq: [{ validator: validateData, trigger: "blur" }],
        ZlrzNum_sbs: [{ validator: validateData, trigger: "blur" }],
        ZlrzNum_bamj: [{ validator: validateData, trigger: "blur" }],
        ZlrzNum_rzmj: [{ validator: validateData, trigger: "blur" }],
        ZlrzNum_rzsl: [{ validator: validateData, trigger: "blur" }],
        ZlrzNum_wghmj: [{ validator: validateData, trigger: "blur" }],
        ZlrzNum_bluecp: [{ validator: validateData, trigger: "blur" }],
        ZlrzNum_bluecpmj: [{ validator: validateData, trigger: "blur" }],
        ZlrzNum_dlsb: [{ validator: validateData, trigger: "blur" }],
        ZlrzNum_dlbh: [{ validator: validateData, trigger: "blur" }],
        ZlrzNum_wghNum: [{ validator: validateData, trigger: "blur" }]
      }
    };
  },
  methods: {
    GetPostUrl() {
      var url =
        this.$http.defaults.baseURL +
        "Report/PostImportData?ReportCode=" +
        this.searchModel.ReportCode +
        "&&AreaCode=" +
        this.searchModel.AreaCode;
      return url;
    },
    //获取今往年数据
    GetData() {
      var self = this;
      var model = new Object();
      model.ReportCode = self.searchModel.ReportCode;
      if (
        self.searchModel.FillInYear != null &&
        self.searchModel.FillInYear != ""
      ) {
        model.FillInYear = self.searchModel.FillInYear;
      } else {
        model.FillInYear = self.CurrentYear + "年"; //填报年度-----数据字典值
        self.searchModel.FillInYear = self.CurrentYear + "年";
      }
      model.AreaCode = self.searchModel.AreaCode;
      self.DataModel = {}; //清空当前数据
      self.$http.post("Report/PostData", model).then(
        //获取数据编辑项的值
        function(res) {
          if (res.data.list.status == 2 || res.data.list.status == 1) {
            self.DataModel = res.data.list.model;            
            self.BtnSaveStatus = true;
          } else {
            self.DataModel = res.data.list.model;
            self.$Modal.warning({
              title: "提示信息",
              content: res.data.list.message
            });
            self.BtnSaveStatus = false;
          }
        }
      );
    },
    convertNum: function(num) {
      //小数点处理
      if (isNaN(num) || num == "null") {
        return "0";
      }
      return Number(num).toFixed(0);
    },
    //上报
    DataUp(id) {
      var self = this;
      if(this.checkData){
      self.$Modal.confirm({
        title: "提示信息",
        content: "<p>是否确认上报？</p>",
        onOk: () => {
          var model = new Object();
          model.Id = id;
          model.reportType = "3";
          model.strMsg = "";
          this.$http.post("Report/PostUpStatus", model).then(function(res) {
            if (res.data.status == 1) {
              self.$Notice.success({ title: "已上报！", desc: false });
              self.GetData();
            } else {
              self.$Modal.error({ title: "提示信息", content: "数据删除失败!!!" });
            }
          });
        }
      });}
    },
    //编辑获取对象传入id
    editInfo(id, reportCode) {
      //编辑
      var self = this;
      this.$http
        .get("Report", { params: { id: id, reportCode: reportCode } })
        .then(
          //获取数据编辑项的值
          function(res) {
            switch (res.data.list.status) {
              case 1:
                self.DataModel = res.data.list.model;
                self.modalShow();
                break;
              case 0:
                self.$Modal.error({ title: "提示信息", content: "编辑数据加载失败!!!" });
                break;
              case -1:
                self.$Modal.error({ title: "提示信息", content: "编辑数据加载失败!!!" });
                break;
            }
          }
        );
    },
    checkData(){
    if(this.DataModel.MarketNum != this.DataModel.CdxMarket*1+this.DataModel.ZypfMarket*1+this.DataModel.QyxzhpfMarket*1){
        toAlertCheckResult( '水果市场个数不等于其子项之和！');
        return false;
    }
    else if(this.DataModel.FruCompanyNum != this.DataModel.ZzNum_country*1+this.DataModel.ZzNum_pro*1+this.DataModel.ZzNum_city*1+this.DataModel.ZzNum_county*1+this.DataModel.ZzNum_other*1){
        toAlertCheckResult('水果企业个数不等于其子项之和！');
        return false;
    }
    else{
        return true;
    }
    },
    toAlertCheckResult(message){  
      this.$Modal.warning({
        title:'提示信息',
        content:message
      });
    },
    //保存方法
    save() {
      var self = this;
      if(this.isTime()){
          this.$refs["DataModel"].validate((valid) =>{     
            if(valid){                
                self.$http.put("FruProsecution", self.DataModel).then(function(res) {
                    if (res.data.status == 1) {
                        self.GetData(); //读取分页数据
                        //self.modalHide();//关闭modal
                        self.$Notice.success({ title: "保存成功！", desc: false });
                    } else {
                       self.$Modal.warning({ title: "提示信息", content: "更新失败,请与管理员联系!" });
                    }
                   });                
            }
            else{
                self.$Modal.error({ title: "提示信息", content: "必须是数字!" });
            }
        });
      }
      else{
          this.$Modal.warning({ title: "提示信息", content: "不在填报时间，无法填报!" });
      }
    },
    //模板下载
    TmpDown: function() {
      window.open(
        this.$http.defaults.baseURL +
          "Report/GetTemplateData?ReportCode=" +
          this.searchModel.ReportCode
      );
    },
    //导入
    GetPostUrl() {
      var url =
        this.$http.defaults.baseURL +
        "FruProsecution/PostImportData?ReportCode=" +
        this.searchModel.ReportCode +
        "&&FillInYear="+this.searchModel.FillInYear+
        "&&AreaCode=" +
        this.searchModel.AreaCode;
      return url;
    },
    //导出
    ExcelDown: function() {
      var self = this;
      var model = new Object();
      model.ReportCode = self.searchModel.ReportCode;
      if (
        self.searchModel.FillInYear != null &&
        self.searchModel.FillInYear != ""
      ) {
        model.FillInYear = self.searchModel.FillInYear;
      } else {
        model.FillInYear = self.CurrentYear + "年"; //填报年度-----数据字典值
        self.searchModel.FillInYear = self.CurrentYear + "年";
      }
      model.AreaCode = self.searchModel.AreaCode;
      window.open(
        this.$http.defaults.baseURL +
          "FruProsecution/GetExcelData?ReportCode=" +
          model.ReportCode +
          "&&FillInYear=" +
          model.FillInYear +
          "&&AreaCode=" +
          model.AreaCode
      );
    },
    handleSuccess(res, file) {
      var self = this;
      self.GetData();
      self.$Notice.success({
        title: "数据导入成功！",
        desc: false
      });
    },
    currentYear(){
        let year = new Date().getFullYear();
        let month = new Date().getMonth();                
        if(month>1){
            this.CurrentYear = year;
        }
        else{
            this.CurrentYear = year - 1;
        }                
    },
    isTime(){
        let month = new Date().getMonth(); 
        let year = new Date().getFullYear()+"年";  
            if(month>2 && month<10&&(this.searchModel.FillInYear==year.toString())){
                return false;
            }
            else{
                return true;
            }
    }    
  },
  //创建Vue页面方法
  created: function() {
    //创业Vue前调用获取this.datas: {},//table数据对象
    this.currentYear();
    this.GetData();
  },
  watch: {
    //需要监听的在此处新增监听对象
  }
};
</script>
